#pragma once

#include "FlashCache.h"
#include "EventsHandler.h"
#include "Storage.h"
#include "Parser.h"
#include "StatisticsHandler.h"
//#include "AggregatedStatisticsHandler.h"
#include "SimulationParameters.h"
#include "LUN.h"
#include "FlashDevice.h"
class PlacementGenerator;


class ComponentsHolder
{
private:
	
	Cache* _cache;
	Cache* _flashCache;
	EventsHandler* _handler;
	//Storage* _storage;
	Parser* _parser;
	StatisticsHandler* _statistics;
	//AggregatedStatisticsHandler* _aggregatedStatistics;
	PlacementGenerator* _placementGenerator;
	FlashDevice* _flashDevice;
	std::map<int,LUN*> _luns;
	ComponentsHolder(void);
public:
	
	virtual ~ComponentsHolder(void);
	static ComponentsHolder* getInstance();

	void clear();

	
	EventsHandler* getEventsHandler();
	Cache* getCache();
	Cache* getFlashCache();
	//Storage* getStorage();
	Parser* getParser();
	StatisticsHandler* getStatisticsHandler();
	//AggregatedStatisticsHandler* getAggregatedStatisticsHandler();
	PlacementGenerator* getPlacementGenerator();
	void setCache(Cache* c);
	LUN* getLUN(int lunID);
	void addLUN(int lunID, int group);
	FlashDevice* getFlashDevice();

};

